import * as API from '@/api/post'

const module = {
    namespaced: true,
    state: () => ({
        postDetail: {},
    }),
    mutations: {
        setPostDetail(state, data) {
            state.postDetail = data
        },
    },
    actions: {
        async getPostDetail({ commit }, { id }) {
            commit('setPostDetail', await API.getPost(id))
        },
    }
}

export default module